package com.fast.pojo.vo;

import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ruan cai yuan
 * @version 1.0
 * @fileName com.fast.pojo.vo.SortableTreeNode
 * @description: TODO
 * @since 2024/6/23 16:56
 */
public class SortableTreeNode<T> {
    /**
     * 主键
     */
    @EqualsAndHashCode.Include
    private String id;

    /**
     * 父级id,-1:没有父级
     */
    private Long parentId;

    /**
     * 排序,越小排序越靠前
     */
    protected Integer orderNo;

    protected List<T> children = new ArrayList<>();

    public void addchild(T child) {
        this.children.add(child);
    }
}
